import request from '@/utils/request'

export const getDepartments = () => {
  return request.get('/company/department')
}

// 获取部门负责人
export const getEmployeesSimple = () => {
  return request.get('/sys/user/simple')
}

// 实现新增功能
export const addDepartments = data => {
  return request.post('/company/department', data)
}

// 实现编辑功能
export const editDepartments = data => {
  return request.put(`/company/department/${data.id}`, data)
}

// 根据ID删除部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 根据Id查询部门详情
export const getDepartmentsDetatil = (id) => {
  return request.get(`/company/department/${id}`)
}
